package cn.tedu.spring.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Value("登录功能")
    private String name ;
    //构造方法
    @Autowired
    public UserService (UserDao userDao) {
        this.userDao=userDao;
    }
    //set()方法
    @Autowired
    public void setUserDao (UserDao userDao) {
        this.userDao = userDao;
    }
    //@Autowired
    private  UserDao userDao;

    @Override
    public String toString() {
        return "UserService{" +
                "name='" + name + '\'' +
                ", userDao=" + userDao +
                '}';
    }
}
